package com.shr.code_interview;

public class Solution_50_1 {
	int[] table = new int[256];
	 StringBuffer sb = new StringBuffer();
    //Insert one char from stringstream
    public void Insert(char ch)
    {
        sb.append(ch);
        table[ch]++;
    }
    //return the first appearence once char in current stringstream
    public char FirstAppearingOnce()
    {
    	char[] arrayChar = sb.toString().toCharArray();
    	for(char ch : arrayChar){
    		if(table[ch] == 1)
    			return ch;
    	}
    	return '#' ;
    }
}
